project(csb)
cmake_minimum_required(VERSION 3.10)

set(TARGET CSB)

file(GLOB CSB_SRC ${CMAKE_CURRENT_LIST_DIR}/src/*.cpp)
add_library(${TARGET} ${CSB_SRC})

# 配置编译选项
if (CMAKE_BUILD_TYPE MATCHES "Debug" OR CMAKE_BUILD_TYPE EQUAL "None" OR NOT CMAKE_BUILD_TYPE)
    target_compile_definitions(${TARGET} PRIVATE "CSB_DEBUG")
endif()

# 链接数学库
target_compile_options(${TARGET} PRIVATE -ffast-math)
target_link_libraries(${TARGET} PRIVATE m)

# 配置头文件查找路径
target_include_directories(${TARGET} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/include)
